import sys

try:
    t = int(input())
    if t < 1 or t > 100:
        sys.exit(0)
    for t in range(t):
        w = int(input())
        n = int(input())
        a = [int(item) for item in input().split()]
        if w in a:
            print("unhappy")
        else:
            print("happy")

except ValueError:
    pass
except EOFError:
    pass
except MemoryError:
    pass